<html>
<head>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<h1>Hello Eddie</h1>
<input name="expression" id="expression" type="text">
<button onclick="js()">计算</button>
<div style="text-align: center">
    您计算的结果是：<span id="res"></span>
</div>
</body>
<script>
    function js() {
        axios.get("/calculator", {
            params: {
                expression: document.querySelector("#expression").value
            }
        }).then(res => {
            document.querySelector("#res").textContent = res.data;
        })
    }
</script>
</html>